package cn.cs.service;

import cn.cs.mapper.ExpensesExplainMapper;
import cn.cs.pojo.ExpensesExplain;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;


@RestController
public class ExpensesExplainService {

    @Resource
    private ExpensesExplainMapper expensesExplainMapper;

    @RequestMapping(value = "/getExpensesExplainById", method = RequestMethod.POST)
    public ExpensesExplain getExpensesExplainById(@RequestParam("id") String id) throws Exception{
        return expensesExplainMapper.getExpensesExplainById(id);
    }

    @RequestMapping(value = "/getExpensesExplainListByMap", method = RequestMethod.POST)
    public List<ExpensesExplain> getExpensesExplainListByMap(@RequestBody Map<String, Object> param) throws Exception{
        return expensesExplainMapper.getExpensesExplainListByMap(param);
    }

    @RequestMapping(value = "/getExpensesExplainCountByMap", method = RequestMethod.POST)
    public Integer getExpensesExplainCountByMap(@RequestBody Map<String, Object> param) throws Exception{
        return expensesExplainMapper.getExpensesExplainCountByMap(param);
    }

    @RequestMapping(value = "/addExpensesExplain", method = RequestMethod.POST)
    public Integer addExpensesExplain(@RequestBody ExpensesExplain expensesExplain) throws Exception{
        return expensesExplainMapper.insertExpensesExplain(expensesExplain);
    }

    @RequestMapping(value = "/modifyExpensesExplain", method = RequestMethod.POST)
    public Integer modifyExpensesExplain(@RequestBody ExpensesExplain expensesExplain) throws Exception{
        return expensesExplainMapper.updateExpensesExplain(expensesExplain);
    }

    @RequestMapping(value = "/deleteExpensesExplainById", method = RequestMethod.POST)
    public Integer deleteExpensesExplainById(@RequestParam("id") String id) throws Exception{
        return expensesExplainMapper.deleteExpensesExplainById(id);
    }

    @RequestMapping(value = "/getAreaById", method = RequestMethod.POST)
    public Map<String, Object> getAreaById(@RequestParam("id") String id) throws Exception{
        return expensesExplainMapper.getAreaById(id);
    }

    @RequestMapping(value = "/getFaultTypeById", method = RequestMethod.POST)
    public Map<String, Object> getFaultTypeById(@RequestParam("id") String id) throws Exception{
        return expensesExplainMapper.getFaultTypeById(id);
    }



}
